<script setup lang="ts">
interface TreeData {
  key: string
  title: string
  children: TreeData[]
}
defineProps<{data: TreeData[]}>()
</script>

<template>
  <ul v-for="item in data" :key="item.key">
    <li>{{item.title}}
      <TreeComponent v-if="item.children" :data="item.children"></TreeComponent>
    </li>
  </ul>
</template>
